<?php
/**
 * Created by PhpStorm.
 * User: lyang
 * Date: 2016/12/31
 * Time: 16:07
 */
 function nosql_by_from($from){
      $db = YC::make("DB");
      $table='yc_nosql';
	  $iData = $db->get(
             $table,
             "*",
             [
                "from[=]"=>$from
             ]
       );
	   return isset($iData["value"])?$iData["value"]:'';
 }
 function nosql_by_field($field){
      $db = YC::make("DB");
      $table='yc_nosql';
	  $iData = $db->get(
             $table,
             "*",
             [
                "field[=]"=>$field
             ]
       );
	   return isset($iData["value"])?$iData["value"]:'';
 } 
 function nosql_by_from_field($argv){
     $from = isset($argv["from"])?$argv["from"]:'';
     $key = isset($argv["key"])?$argv["key"]:'';
     $db = YC::make("DB");
     $table='yc_nosql';
	$iData = $db->get(
	 $table,
	 "*",
	 [
		 "AND"=>[
			 "from[=]"=>$from,
			 "field[=]"=>$key,
		 ]
	 ]
	); 
	   return isset($iData["value"])?$iData["value"]:'';
 }